﻿<cfcomponent>
<cfscript>
This.Sessionmanagement = true;
this.datasource="chinalaohu";
DB="chinalaohu";
domain = "http://adio.chinalaohu.com";
</cfscript>

<cffunction name="home0" access="remote" returntype="any" returnFormat="json">
<cfscript>
rs = {"success": 1,"logo": [{"url": "http://adio.chinalaohu.com/app/pic/home_logo.jpg","type": "0","cateId":1}],"china":{"cateId":1,"url": ["http://192.168.6.104/app/pic/home_china.jpg"]},"darktea":{"cateId":2,"url": ["http://192.168.6.104/app/pic/home_darktea.jpg"]}};
return rs;
</cfscript>
</cffunction>

<cffunction name="home" access="remote" returntype="any" returnFormat="json">
<cfparam name="platform" default="0" >

	<!---记录平台--->
  <cfif isdefined('imsi')>
  <cfquery datasource="#DB#">
  insert into app_homelog(ver,display,sdk,imsi,imei,platform,dt)
  value('#ver#','#display#','#sdk#','#imsi#','#imei#','#platform#',#now()#)
  </cfquery>
  </cfif>
  


	<cfquery datasource="#DB#" name="home">
  select json
  from app_theme
  where page = 'home' AND platform='#platform#'
  </cfquery>
  <cfscript>
	j = home.json;
	j = DeserializeJSON(j);
	//j = replace(j,'/','\/','ALL');
	j = createObject("component",'cfjson').encode(j);
	//j = DeserializeJSON(j);
	return j;
	</cfscript>
  
 
  
<cfscript>
/*rs = {"success": 1,
"logo": [{"url": domain & "/app/pic/home_logo.jpg","type": 0,"cateId":1},{"url": domain & "/app/pic/tmp/88437607.jpg","type": 0,"cateId":1},{"url": domain & "/app/pic/tmp/88437608.jpg","type": 0,"cateId":1}],
"china":{"cateId":1,"url": [domain & "/app/pic/home_china.jpg"]},
"darktea":{"cateId":2,"url": [domain & "/app/pic/home_darktea.jpg"]}
};
return rs;*/
</cfscript>
</cffunction>

</cfcomponent>